﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Common_CommGroups : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MasterPage_MasterPage mpg = (MasterPage_MasterPage)this.Page.Master;
            mpg.HelpHref = "~/Help/Common/代理设置.htm";
            mpg.PageName = "当前用户的所有角色";
            mpg.PicUrl = "";
            mpg.IntiBar();


            string userid = Srvtools.CliUtils.fLoginUser;
            if (userid == null || userid == string.Empty)
            {
                this.Response.Redirect("~//Infologin.aspx?IsFlowPage=true");
                this.Response.End();
            }
            else
            {
                object[] objParam = new object[1];
                objParam[0] = userid;
                object[] myRet = Srvtools.CliUtils.CallMethod("Common", "GetGroupsByUserId", objParam);
                if (myRet != null && (int)myRet[0] == 0)
                {
                    DataSet ds = (DataSet)myRet[1];

                    this.gvGroups.DataSource = ds.Tables["Groups"];
                    this.gvGroups.DataBind();
                }
            }

        }
    }
}
